Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: log unhandled error even if its stack is empty #14619

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

the-ress
Copy link
Contributor

@the-ress the-ress commented Oct 13, 2023

Summary

I ran into an issue when jest (jest --coverage --runInBand --testTimeout=120000) would stop with exit code 1 without any error message.

Upon further investigation, I found it's caused by uncaughtException handler in CoverageWorker.ts that only logs err.stack and the error I was encountering didn't have any stack (it was set to an empty string).

Test plan

I ran jest --coverage --runInBand --testTimeout=120000 again and the error message got printed to console as expected:

error TS2307: Cannot find module '[redacted]' or its corresponding type declarations.

I didn't find any automated tests covering this behavior and I can't think of a good way to implement one.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 13, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: the-ress / name: Tereza Tomcova (eed1412)

@netlify
Copy link

netlify bot commented Oct 13, 2023

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit eed1412
🔍 Latest deploy log https://app.netlify.com/sites/jestjs/deploys/65299d6f1c7e140008083e2c
😎 Deploy Preview https://deploy-preview-14619--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@the-ress the-ress force-pushed the log-errors-without-stack branch from 563745b to eed1412 Compare October 13, 2023 19:41
@SimenB SimenB merged commit a30a52f into jestjs:main Oct 13, 2023
60 checks passed
@SimenB
Copy link
Member

SimenB commented Oct 13, 2023

Thanks!

@the-ress the-ress deleted the log-errors-without-stack branch October 13, 2023 20:26
@SimenB
Copy link
Member

SimenB commented Oct 30, 2023

Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants